
public class Example4 {
	public static void main(String[] args) {
		int sum = 0;
		for(int i=1;i<=100; i++) {
			sum+=i;
		}
		System.out.printf("1到100累加和是%d",sum);
		System.out.println();
		int sum1 = 0;
		int i = 1;
		while( i <=100 ) {
			sum1 += i;
			i++;
		}
		System.out.printf("1到100累加和是%d",sum1);
		System.out.println();
		int sum2 = 0;
		int i2 = 1;
		do{
			sum2 += i2;
			i2++;
		}while(i2<=100);
		System.out.printf("1到100累加和是%d",sum2);
		System.out.println();
	}
}
